*
* Purpose:
* 	add contract capacities
*
* Authors:
*	Sandor Sovago
*
* Last update:
*	Sept 18, 2022
*

bys contract_id: egen num_rejected = sum(rejected)
bys contract_id: egen num_admitted = sum(admitted)

gen capacity = .
replace capacity = num_admitted if num_admitted > 0 & num_rejected > 0
replace capacity = floor(max(10, num_admitted*1.1)) if num_admitted > 0 & num_rejected == 0
replace capacity = 0 if num_admitted == 0
drop num_rejected num_rejected rejected
lab var capacity "Capacity"

